package com.onlinewebgames.tictactoe.models;

import java.io.Serializable;


public class LoggedUser implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static String user = null;
	private static String pass = null;
	private static String name = null;

	private static GameListAndStates partidasDelUsuario;
	
	private static Partida selectedGame;

	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		LoggedUser.name = name;
	}
	
	
	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		LoggedUser.user = user;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		LoggedUser.pass = pass;
	}

	public static GameListAndStates getPartidasDelUsuario() {
		return partidasDelUsuario;
	}

	public static void setPartidasDelUsuario(GameListAndStates partidasDelUsuario) {
		LoggedUser.partidasDelUsuario = partidasDelUsuario;
	}

	
	public static Partida getSelectedGame() {
		return selectedGame;
	}

	public static void setSelectedGame(Partida selectedGame) {
		LoggedUser.selectedGame = selectedGame;
	}

	public static boolean isAnyLoggedUser()
	{
		return (user != null);
	}
	
	
	/**
	 * Resets current loged user
	 * All fields will be null
	 */
	public static void resetLoggedUser()
	{
		user = null;
		pass = null;
		selectedGame = null;
		
	}
	
}
